<template>
  <Menu
    :active-name="activeRouteName"
    :open-names="['1']"
    class="menu-width"
    @on-select=selectItem
  >
    <Submenu name="1">
      <template slot="title">
        <Icon type="social-designernews"></Icon>
        点餐
      </template>
      <MenuGroup title="操作">
        <MenuItem name="OrderConfig">基本设置</MenuItem>
        <MenuItem name="GraphDetail">报表详情</MenuItem>
      </MenuGroup>
    </Submenu>
  </Menu>
</template>

<script>
  export default {
    data() {
      return {}
    },
    computed: {
      activeRouteName() {
        return this.$route.name
      }
    },
    methods: {
      selectItem(name) {
        switch (name) {
          case 'OrderConfig':
            this.$router.push({name: 'OrderConfig'});
            break;
          case 'GraphDetail':
            this.$router.push({name: 'GraphDetail'});
            break;
        }
      }
    },
    created() {
    }
  }
</script>

<style lang='less' type='text/less' scoped>
  .menu-width {
    width: @layout1AsideWidth !important;
    height: 100%;
  }
</style>
